package org.biubiu0002.baiblog.core.localcache;

import org.biubiu0002.baiblog.core.service.SysRoleService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;

/**
 * @Author: biubiu0002
 * @Date: 2022-05-17 0:22
 **/
@Component
public class RolePermissionCacheService extends BaseCacheService<String, List<String>>{

    @Resource
    SysRoleService sysRoleService;


    @Override
    public List<String> loadData(String role) {
        return sysRoleService.getResourceMethodByNameList(Collections.singletonList(role));
    }
}
